static char *snwhiteopt = NULL;
static char *deficon = NULL;
static char *category = NULL;
+static char *categorybitsopt = NULL;
+static int categorybits;
#define MILITANT_VALID_WAYPT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
{ "category", &category, "Category number to use for written waypoints",
NULL, ARGTYPE_INT, "1", "16"},
+ { "bitscategory", &categorybitsopt, "Bitmap of categories",
+ NULL, ARGTYPE_INT, "1", "65535"},
ARG_TERMINATOR
};
return;
}
+ if (categorybitsopt) {
+ categorybits = strtol(categorybitsopt, NULL, 0);
+ }
+
if (GPS_Init(fname) < 0) {
fatal(MYNAME ":Can't init %s\n", fname);
}
if (receiver_charset)
cet_convert_init(receiver_charset, 1);
+
+
}
static void
if (category) {
way[i]->category = 1 << (atoi(category) - 1);
}
+ if (categorybits) {
+ way[i]->category = categorybits;
+ }
#if SOON
garmin_fs_garmin_before_write(wpt, way[i], gps_waypt_type);
#endif
/*******************************************************************************/
-/* static char gdb_release[] = "$Revision: 1.61 $"; */
-static char gdb_release_date[] = "$Date: 2008/01/09 23:06:04 $";
+/* static char gdb_release[] = "$Revision: 1.62 $"; */
+static char gdb_release_date[] = "$Date: 2008/04/06 03:41:10 $";
static gbfile *fin, *fout;
static int gdb_ver, gdb_category, gdb_via, gdb_roadbook;
static char *gdb_opt_ver;
static char *gdb_opt_via;
static char *gdb_opt_roadbook;
+static char *gdb_opt_bitcategory;
static int waypt_flag;
static int route_flag;
MYNAME ": cat must be between 1 and 16!");
gdb_category = 1 << (gdb_category - 1);
}
+
+ if (gdb_opt_bitcategory) {
+ gdb_category = strtol(gdb_opt_bitcategory, NULL, 0);
+ }
+
if (gdb_ver >= GDB_VER_UTF8)
cet_convert_init(CET_CHARSET_UTF8, 1);
#define GDB_OPT_VER "ver"
#define GDB_OPT_VIA "via"
#define GDB_OPT_CATEGORY "cat"
+#define GDB_OPT_BITCATEGORY "bitcategory"
#define GDB_OPT_ROADBOOK "roadbook"
static arglist_t gdb_args[] = {
{GDB_OPT_CATEGORY, &gdb_opt_category,
"Default category on output (1..16)",
NULL, ARGTYPE_INT, "1", "16"},
+ {GDB_OPT_BITCATEGORY, &gdb_opt_bitcategory, "Bitmap of categories",
+ NULL, ARGTYPE_INT, "1", "65535"},
{GDB_OPT_VER, &gdb_opt_ver,
"Version of gdb file to generate (1..3)",
"2", ARGTYPE_INT, "1", "3"},
{GDB_OPT_ROADBOOK, &gdb_opt_roadbook,
"Include major turn points (with description) from calculated route",
NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
+
ARG_TERMINATOR
};
--- /dev/null
+<para>
+ This option is closely related to the 'category' option. While category
+ allows you to choose a single category that waypoints should appear in,
+ this options allows you to specify a bitmask to be used for the category.
+ Options may be specified in either decimal or hex.
+</para>
+<example id="garmin_bitcategory">
+ <title>Example for garmin bitcategory option to put all waypoints in categories 1 and 16.</title>
+<para>
+ The following two commands are equivalent. They place a the point in both the first and last of the sixteen available categories.
+ <userinput>
+ gpsbabel -i gpx -f PocketQuery.gpx -o garmin,bitcategory=32769 -F usb:
+ </userinput>
+ <userinput>
+ gpsbabel -i gpx -f PocketQuery.gpx -o garmin,bitcategory=0x8001 -F usb:
+ </userinput>
+
+</para>
+</example>
--- /dev/null
+<para>
+ This option is closely related to the 'category' option. While category
+ allows you to choose a single category that waypoints should appear in,
+ this options allows you to specify a bitmask to be used for the category.
+ Options may be specified in either decimal or hex.
+</para>
+<example id="gdb_bitcategory">
+ <title>Example for gdb bitcategory option to put all waypoints in categories 1 and 16.</title>
+<para>
+ The following two commands are equivalent. They place a the point in both the first and last of the sixteen available categories.
+ <userinput>
+ gpsbabel -i gpx -f PocketQuery.gpx -o gdb,bitcategory=32769 -F foo.gdb
+ </userinput>
+ <userinput>
+ gpsbabel -i gpx -f PocketQuery.gpx -o gdb,bitcategory=0x8001 -F foo.gdb
+ </userinput>
+
+</para>
+</example>